#include<stdio.h>
int main()
#pragma warning(disable:4996)
{
	float a;
	scanf("%f", &a);
	int count = (int)a;
	printf("%d", count%10);
	return 0;
}
